﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BlackJack.model.rules
{
    class PlayerWinsOnSame : IWinRule
    {
        public int MaxScore { get; set; }

        internal IWinRule IWinRule
        {
            get
            {
                throw new System.NotImplementedException();
            }
            set
            {
            }
        }

        public PlayerWinsOnSame(int maxScore)
        {
            MaxScore = maxScore;
        }

        public bool IsDealerWinner(Player a_player, Player a_dealer)
        {
            if (a_player.CalcScore() > MaxScore)
            {
                return true;
            }
            else if (a_dealer.CalcScore() > MaxScore)
            {
                return false;
            }
            return a_dealer.CalcScore() > a_player.CalcScore();
        }
    }
}
